<div id="edit-title">创建主货品</div>
<div>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
		<input type="hidden" name="rand" value="<?php echo $form['rand']; ?>" />
		<div class="edit-name">货品类目 <?php echo form_error('type_id', '<span class="error">', '</span>'); ?></div>
		<div class="edit-select">
			<select name="type_id">
				<option>选择类目</option>
				<?php foreach ($form['types'] as $type) { ?>
				<option value="<?php echo $type->id ?>" <?php echo set_select('type_id', $type->id) ?>><?php echo $type->name ?></option>
				<?php } ?>
			</select>
		</div>
		<div class="edit-name">货号 <?php echo form_error('number', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="number" value="<?php echo set_value('number') ?>" /></div>
		<div class="edit-name">货品名称 <?php echo form_error('name', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="name" value="<?php echo set_value('name') ?>" /></div>
		<div class="edit-name">搜索代码 <?php echo form_error('search_code', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="search_code" value="<?php echo set_value('search_code'); ?>" /></div>
		<div class="edit-name">淘宝链接 <?php echo form_error('taobao_link', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="taobao_link" value="<?php echo set_value('taobao_link') ?>" /></div>
		<div class="clear"></div>
		<div class="edit-submit"><input type="submit" value="创建" /></div>
	</form>
</div>
<script type="text/javascript">
$(function(){
	$('.option').bind('click', function(){form.select._click($(this))});
})
</script>